#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

pair<LL, LL> f(int n){
    LL y1 = 0, y2 = 0;
    LL sum = 1;
    for(int i=1; i<=n; ++i){
        sum *= i;
        if(i&1) y1+=sum;
        else y2 += sum;
    }
    return {y1, y2};
}

int main(){
    int n;
    while(cin>>n){
        auto res = f(n);
        cout<<res.first<<' '<<res.second<<endl;
    }
    return 0;
}